#ifndef COMBOBOXITEMDELEGATE_HXX
#define COMBOBOXITEMDELEGATE_HXX

#include <QStyledItemDelegate>
#include <QObject>

class Project;

class ComboBoxItemDelegate : public QStyledItemDelegate
{
    Q_OBJECT
public:
    ComboBoxItemDelegate(QObject *parent = nullptr);
    ~ComboBoxItemDelegate();

    QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
    void setEditorData(QWidget *editor, const QModelIndex &index) const override;
    void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override;
    
    inline void setProject(Project* project) { _project = project; }
private:
    Project* _project;
};

#endif // COMBOBOXITEMDELEGATE_HXX
